home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Scripts / Illustrator.vu < prev    next >
Encoding:
Text File  |  1993-12-17  |  8.3 KB  |  223 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        Illustrator.vu
  5. #
  6. #    Contains:    Quick look test script for Adobe Illustrator version 3.2
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.2>     6/16/93    NAGA        Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
  19. #        <1+>     5/25/93    NAGA        Adding header and porting old files to follow new standards
  20. #
  21. # ****************************************************************************
  22. #
  23.  
  24.  
  25.  
  26. ########################################################################
  27. #                            External libraries 
  28. #=======================================================================
  29. Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
  30.  
  31.  
  32. #########################################################################
  33. ########               Application Specific Tasks
  34. #########################################################################
  35.  
  36. #########################################################################
  37. #                        InitAppGlobals()
  38. #========================================================================
  39. # Author:        Kevin Avoy
  40. # Description:    Sets up tools and fonts for Illustrator.  This task
  41. #                must be called first.
  42. # Parameters:    None
  43. # Returns:        Nothing
  44. # Examples:        InitAppGlobals()
  45. #========================================================================
  46. # History:
  47. #
  48. #########################################################################
  49. task InitAppGlobals()
  50. begin
  51.     
  52.     logstr("setting up {global gApptitle}'s globals");            
  53.     global kClick, kDrag, kDragClick, kMultiDrag, kMultiClickDrag, kMultiClick;
  54.     global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
  55.     global kToolPaletteNum := 1; 
  56.     global kLinePaletteNum := 0;
  57.     global kPatternPaletteNum := 0;
  58.     global kColorPaletteNum := 2;
  59.  
  60.     global gLineWeights := {};
  61.                         
  62.     global gWindowInset := {0,20,20,20};        # Window inset
  63.     global gScreenInset := {33,20,0,0};            # Screen inset
  64.     global gVoidRect := {};        # Rect not to draw in - coordinates should be RelativeToWindow
  65.     global gTextStr;
  66.     global gDocumentWindow := 0;
  67.     
  68.     global gPaletteList :=    {
  69.                             {                        #### Start Palette #1 - Tools
  70.                             {0, 39, 28, 324},        # Location of palette absolute Coordinates
  71.                             kPalDocWind,            # Palette type
  72.                             {1,16},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  73.                             {0,18}                    # Offset between tools {h,v}
  74.                             }                        #### End Palette #1
  75.     };
  76.     
  77.     
  78.     ### Illustrator                                                                    {Flag, Pattern, Line, Color}
  79.     ### Palette Elements:=        Tool#, Pal#,     ToolName,     ToolType,    DblClktoEnd        SetAttributes
  80.     global ArrowTool         :=     { 1,     1,        "Arrow",        kClick,         0,                 {0}};
  81.     global ZoomTool         :=     { 2,     1,        "Zoom",         kClick,        0,                 {0}};
  82.     global CharTool            :=     { 3,     1,        "Character",    kDrag,         0,                 {gTextStr}};
  83.     global Freehand            :=     { 4,      1,        "Freehand",        kMultiDrag,    0,                 {0}};
  84.  
  85.     global PenTool             :=     { 5,     1,        "Pen",            kMultiClick,1,                 {0}};
  86.     global RectTool         :=     { 6,      1,        "Rectangle",    kDrag,         0,                 {0}};
  87.     global OvalTool             :=     { 7,      1,        "Oval",            kDrag,        0,                 {0}};
  88.     global BlendTool         :=     { 8,      1,        "Blend",        kDragClick, 0,                 {0}};
  89.  
  90.     global ScaleTool         :=     { 9,     1,         "Scale",        kDragClick,    0,                 {0}};
  91.     global RotateTool        :=     { 10,     1,        "Rotate",        kDragClick, 0,                 {0}};
  92.     global ReflectTool        :=     { 11,     1,        "Reflect",        kDragClick, 0,                 {0}};
  93.     global ShearTool        :=     { 12,     1,        "Shear",        kDragClick, 0,                 {0}};
  94.  
  95.     global SplitPathTool    :=     { 13,     1,         "SplitPath",    kClick,        0,                 {0}};
  96.     global MeasureTool         :=     { 14,     1,         "Measure",        kDragClick,    0,                 {0}};
  97.     global PageTool             :=     { 15,     1,         "Page",            kClick,        0,                 {0}};
  98.     global GraphTool         :=     { 16,     1,         "Graph",        kDrag,        0,                 {0}};
  99.  
  100.  
  101.     # global Tool list
  102.     global gToolList:={    ArrowTool, 
  103.                         ZoomTool,
  104.                         CharTool,
  105.                         Freehand,
  106.                         
  107.                         PenTool,
  108.                         RectTool,
  109.                         OvalTool,
  110.                         #BlendTool,
  111.                         
  112.                         ScaleTool,
  113.                         RotateTool,
  114.                         ReflectTool,
  115.                         ShearTool,
  116.                         
  117.                         #SplitPathTool,
  118.                         #MeasureTool,
  119.                         PageTool
  120.                         #GraphTool                    
  121.     };
  122.     
  123.             ### font characteristic lists
  124.     global gFontList := {'Helvetica'};                    # Has only Helvetica as menuitem
  125.     global gFontSizeList := {'7','8','9','10','12','14','18', '24','36','48','72'};
  126.     global gFontStyleList := {};                        # Does not have Styles as a menuitem
  127.     global gCurrFontMenu := FindMenu(gFontList[1]);        # Put this here since SetFont uses hard coded Chicago
  128.     
  129.         ### Name of the Plain (style) menu item  ####
  130.     global gPlainStyle := "";            # Plain-Style menu item
  131.  
  132.         ### How to get to the next line
  133.     global gNextLineMethod := 1;            
  134.         ### 1 - ReturnKey,  2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
  135.     
  136.         ### Does moving to the next line clear all font info
  137.     global gNextLineClearsFontSettings := 0;                        
  138.  
  139. end; # InitAppGlobals
  140.  
  141. #########################################################################
  142. #                        DoTextIllustrator()
  143. #========================================================================
  144. # Author:        KTA
  145. # Description:    Test fonts in Illustrator. 
  146. # Parameters:    None
  147. # Returns:        Nada
  148. # Examples:        DoTextIllustrator();
  149. # Assumptions:    Illustrator
  150. #========================================================================
  151. # History:
  152. #
  153. #########################################################################
  154. task DoTextIllustrator()
  155. begin
  156.     Draw(global CharTool,,0,0,0,0); 
  157.     wait(3);
  158.     DoText();
  159.     SpecialKey(EnterKey, "EnterKey");
  160. end;
  161.  
  162. #########################################################################
  163. #                        IllustratorScrapText()
  164. #========================================================================
  165. # Author:        KTA
  166. # Description:    Test scraptext in Illustrator. 
  167. # Parameters:    None
  168. # Returns:        Nada
  169. # Examples:        IllustratorScrapText();
  170. # Assumptions:    Illustrator
  171. #========================================================================
  172. # History:
  173. #
  174. #########################################################################
  175. task IllustratorScrapText()
  176. begin
  177.     Draw(global CharTool,,0,0,0,0); 
  178.     wait(3);
  179.     ScrapBook(global kScrapText);
  180. end;
  181.  
  182. ################################################################################
  183. ####################             Main script                    ####################
  184. ################################################################################
  185. script Illustrator (ScriptLevel:= -1)
  186. begin
  187.     InitGlobals(ScriptLevel);            # initialize your general globals
  188.     InitDraw();
  189.     InitFonts();
  190.     global gAppTitle := 'Adobe Illustrator';     # Title of app you will be running
  191.     global gAppVersion := '3';        # version of app you will be running
  192.     SuiteStart('Illustrator.vu');                    # begin a new test suite
  193.     if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
  194.     begin
  195.         global gFileName := "@!@-{gBuildVers}-Illustrator";    # This is used in NameOK when saving files
  196.         global gCustomScrapText    := task IllustratorScrapText; # hook for custom scraptext in DoSetUpApp 
  197.         InitAppGlobals();                                    # init app specific globals
  198.         (*
  199.         *)
  200.         DoSetUpApp(,,,"None N",1,,1);    # Illustrator doesn't accept Picts from scrap
  201.         DoDraw();
  202.         DoTextIllustrator();
  203.         DoWindow();
  204.         DoCloseApp();        
  205.         LogStr("############################# LIMITATIONS: ############################");
  206.         LogStr("NOTE: Illustrator doesn't accept pict from scrap");
  207.         LogStr("NOTE: Fonts other than 'Helvetica' and all styles are only contained
  208.         within dialog boxes so not tested in DoText");
  209.         LogStr("NOTE: Illustrator doesn't support revert");
  210.     end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
  211.     SuiteEnd();
  212. end;    #    script Canvas
  213.  
  214. ### What's Needed
  215. # 1) Insure that Palette is up and in the left corner or the screen
  216. # 2) Insure that Drawing window does not cover any portion of the palette
  217. # 3) Insure that Pointer tool is selected after DoText before DoWindow 
  218. # 4) Illustrator doesn't accept text or Picts from scrap
  219. # 6) Fonts and Styles are only contained within dialog boxes
  220. # 7) DoTextIllustrator is called/ need to set up global check so text tool isn't always selected.
  221. # 8) Palette is really palette of popups
  222.  
  223.